#!/bin/bash

__GLOB_LINES=0
__ROOT_DIR='.'

if [ $# -eq 1 ]
then
    __ROOT_DIR=$1;
fi


for i in $(find $__ROOT_DIR -name "*.py")
do 
    __F_LINES=$(wc -l $i |cut -d " " -f 1);
    echo $((__GLOB_LINES+=$__F_LINES)) > /dev/null;
done

echo "Lines = $__GLOB_LINES"


